<?php
namespace application\Model;

use library\Core\Db\CDbOperator;
use library\Core\Db\CDbCriteria;

use application\Table\Adimage;

class AdimageModel extends CDbOperator {
    
   public function getListForClass(CDbCriteria $criteria){
        
        $criteriaBuilder = $criteria->getCriteriaBuilder(Adimage::getInstance());
        return $this->query($criteriaBuilder);
        
    }
    
    public function getListForArray(CDbCriteria $criteria){
    
        $criteriaBuilder = $criteria->getCriteriaBuilder(Adimage::getInstance());
        return $this->query($criteriaBuilder,true);
    
    }

    public function getCount(CDbCriteria $criteria){
        $criteriaBuilder = $criteria->getCriteriaBuilder(Adimage::getInstance());
        return count($this->query($criteriaBuilder,true));

    }
    
    public function getRow(CDbCriteria $criteria){
        
        $criteriaBuilder = $criteria->getCriteriaBuilder(Adimage::getInstance());
        return $this->queryRow($criteriaBuilder,true);
    
    }
    
    public function getOne(CDbCriteria $criteria){
        
        $criteriaBuilder = $criteria->getCriteriaBuilder(Adimage::getInstance());
        return $this->queryOne($criteriaBuilder,true);
    
    }
    
    public function add(CDbCriteria $criteria){
        
        $criteriaBuilder = $criteria->getCriteriaBuilder(Adimage::getInstance());
        return $this->insert($criteriaBuilder);
    }
    
    public function modify(CDbCriteria $criteria){
        
        $criteriaBuilder = $criteria->getCriteriaBuilder(Adimage::getInstance());
        return $this->update($criteriaBuilder);
    }
    
    public function remove(CDbCriteria $criteria){
    
        $criteriaBuilder = $criteria->getCriteriaBuilder(Adimage::getInstance());
        return $this->delete($criteriaBuilder);
    }
}
